package com.zbl.zblproject.core.entity;

import java.util.Collection;

/**
 * @author youlanqiang
 * @version 1.0
 * @date 2018/12/6
 * 分页
 */
public class MiniPage {

    /**
     * 总条数
     */
    private int total;

    /**
     * 当前分页数量
     */
    private int size;

    /**
     * 当前页面
     */
    private int current;

    /**
     * 分页项
     */
    private Collection<Object> collection;


    public MiniPage(){

    }

    public MiniPage(int total, int size, int current){
        this.total = total;
        this.size = size;
        this.current = current;
    }


    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getCurrent() {
        return current;
    }

    public void setCurrent(int current) {
        this.current = current;
    }

    public Collection<Object> getCollection() {
        return collection;
    }

    public void setCollection(Collection<Object> collection) {
        this.collection = collection;
    }

    public int getPagesize() {
        return  (total + size-1) / size;
    }

    public void setPagesize(int pagesize) {
        //do-not
    }

    @Override
    public String toString() {
        return "MiniPage{" +
                "total=" + total +
                ", size=" + size +
                ", current=" + current +
                '}';
    }
}
